import React from "react";
import { Button, Card, ResultPage } from "antd-mobile";
import { useNavigate, useSearchParams } from "react-router-dom";

const Index = () => {
  const navigate = useNavigate();
  const [sq] = useSearchParams();

  //http://localhost:5173/success?charset=utf-8&
  // out_trade_no=150000199201044696& //out_trade_no 是商户订单号，要和支付时候的一样
  // method=alipay.trade.wap.pay.return& //支付方式
  // total_amount=1160.00&//支付金额（单位：元）
  // sign=PygoeHfmW6T%2FpOHZmUei5pUlyckyM77Q368pB%2BCvT7tUK3%2FwJS%2BGo%2FT5zufcJO3F3EX4aoBrYORTVh2YhAZn5K2SnduBYkTYumV5a2MLOP8pSh9iKaFK%2FO2x45HgNLdya8vxbQREUaoKT0NFAahOiRW5U4Vlu2Tu61vnhUe%2BW2kP5wsBIK8hVaJyZ5OTDjPzflG7hDhtPkVUb%2B4DpxA9P57hTDqxfswW3KyIvd6yUpPk6sIAz8PEYcfGhIXQ5DrL4S%2Bdv2B7gGUCnSr6jbSOQu7doeChX%2FrLEr%2BxnnrV0jqywF57nWOWL4tJtP4gwxPpgH3C%2BSITrLUwuBS2zEwV4w%3D%3D&
  // trade_no=2025072822001499420506849535&//支付宝交易号
  // auth_app_id=9021000133628166&//支付宝分配给开发者的应用ID
  // version=1.0&app_id=9021000133628166&//
  // sign_type=RSA2&//签名类型
  // seller_id=2088721025496321&//卖家ID
  // timestamp=2025-07-28+16%3A24%3A33//时间戳
  console.log(sq.get("out_trade_no"));
  const details = [
    {
      label: "收款方",
      value: "张三",
      bold: true,
    },
    {
      label: "付款方式",
      value: "账户余额",
    },
    {
      label: "转账金额",
      value: "¥100.00",
    },
    {
      label: "转账金额",
      value: "¥100.00",
    },
    {
      label: "转账金额",
      value: "¥100.00",
    },
  ];

  return (
    <ResultPage
      status="success"
      title="操作成功"
      description="内容详情可折行，建议不超过两行建议不超过两行建议不超过两行"
      details={details}
    >
      <Card>
        <Button onClick={() => navigate("/")}>返回首页</Button>
      </Card>
    </ResultPage>
  );
};

export default Index;
